<template>
  <image class="share"
	 :style="{
	 	'height': pxToRpx(setAttr('dragConfig', 'h')),
	 	'width': pxToRpx(setAttr('dragConfig', 'w')),
		'top': pxToRpx(setAttr('dragConfig', 'top')),
		'left': setAttr('configH5', 'left'),
	 }" :src="getScr()">
</template>

<script>
import {pxToRpx} from './tools.js'
export default {
  name: 'DImage',
	props: {
		formItem:{
			type: Object,
			default: {}
		}
	},
  mounted() {
    console.log(this.formItem, 9999)
  },
  methods: {
		pxToRpx: pxToRpx,
		setAttr(configKey, valKey){
			let _self = this
			if(configKey == 'formItem'){
				return _self.formItem[valKey]
			}else{
				if(!_self.formItem[configKey]) return
				return _self.formItem[configKey][valKey]
			}				
		},
    getScr(){
      let _self = this
      let {imageUrl} = _self.formItem['configH5']
      return imageUrl || ''
    },
  },
}
</script>

<style scoped>
.share{
  position: absolute;
	z-index: 100;
}
</style>
